package ru.pb.game.controllers;

import ru.pb.game.network.clients.AuthServerClient;
import ru.pb.game.network.engine.auth.packets.GameServerToAuthServerPacket;

/**
 * @author Felixx
 */
public class AuthServerController
{
	private static AuthServerController _instance;
	private volatile boolean _shutdown;

	private static AuthServerClient _client;

	public static AuthServerController getInstance()
	{
		if(_instance == null)
		{
			_instance = new AuthServerController();
		}
		return _instance;
	}

	private AuthServerController()
	{

	}

	public void shutdown()
	{
		_shutdown = true;
	}

	public boolean isShutdown()
	{
		return _shutdown;
	}

	public static void sendPacket(GameServerToAuthServerPacket packet)
	{
		if(_client != null)
		{
			_client.sendPacket(packet);
		}
	}

	public void setClient(AuthServerClient client)
	{
		_client = client;
	}
}